﻿
@model APIUsersEntity
@{
    ViewData["Title"] = "接口用户表 编辑";
}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content text-center p-md">
                    <form id="dynamic-form" asp-action="Edit" method="post" class="form-horizontal" role="form">
                        <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                       
                        <div class="form-group">
                            <label asp-for="UserNo" class="col-md-3 control-label text-right">用户编号</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input id="UserNo" name="UserNo"  @(string.IsNullOrWhiteSpace(Model.UserNo)?"":"readonly")  value="@Model.UserNo" class="form-control" validate="{required:true ,number:true,minlength:10,maxlength:20   }" />
                                </div>
                                <span asp-validation-for="UserNo" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="UserName" class="col-md-3 control-label text-right">用户名称</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="UserName" class="form-control" validate="{required:true ,maxlength:50   }" />
                                </div>
                                <span asp-validation-for="UserName" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="Password" class="col-md-3 control-label text-right">密码</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="Password" class="form-control" validate="{required:true ,maxlength:50   }" readonly />
                                    <div class="input-group-btn ">
                                        <button class="btn btn-white" type="button" id="btn_reset_password">重置</button>
                                    </div>
                                </div>
                                <span asp-validation-for="Password" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="Md5Key" class="col-md-3 control-label text-right">密钥</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="Md5Key" class="form-control" validate="{required:true ,maxlength:50   }" readonly />
                                    <div class="input-group-btn ">
                                        <button class="btn btn-white" type="button" id="btn_reset_md5">重置</button>
                                    </div>
                                </div>
                                <span asp-validation-for="Md5Key" class="text-danger"></span>
                            </div>

                        </div>
                        
                        <div class="form-group">
                            <label asp-for="CacheTime" class="col-md-3 control-label text-right">缓存时间</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="CacheTime" class="form-control" type="number" validate="{required:true ,number:true,min:10    }" value="30"/>
                                </div>
                                <span asp-validation-for="CacheTime" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="Remark" class="col-md-3 control-label text-right">描述</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon"></span>
                                    <textarea class="form-control" rows="5" asp-for="Remark"></textarea>
                                </div>
                                <span asp-validation-for="Remark" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <a class="btn btn-white" asp-action="index">返  回</a>
                                <button class="btn ladda-button btn-primary" type="submit" data-style='zoom-in'>保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@section scripts{
    <script type="text/javascript">
    $(function () {
        $(document).ready(function () {
            $(".form-horizontal").CustomForm({
                isValidate: true,
                isTable: false
            });
            $(".form-horizontal").submit(function () {
                if (!$(".form-horizontal").valid())
                {
                    return false;
                }
            });
            $("#btn_reset_password").click(function () {
                $(this).parent().parent().find("input").val(Notify.Guid());
            });
            $("#btn_reset_md5").click(function () {
                $(this).parent().parent().find("input").val(Notify.Guid());
            });
	  });
    });
    </script>
}
